<?php

/**
 * This is the model class for table "jumlahindustripekerja".
 *
 * The followings are the available columns in table 'jumlahindustripekerja':
 * @property integer $jip_id
 * @property string $jip_kodejenis
 * @property integer $jip_jumlah_industri
 * @property integer $jip_jumlah_produksi
 * @property integer $jip_jumlah_lain
 * @property integer $jip_jumlah_pemilik
 * @property integer $jip_jumlah
 * @property integer $jip_pengeluaran
 * @property integer $jip_tahun
 */
class Jumlahindustripekerja extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahindustripekerja the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahindustripekerja';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jip_jumlah_industri, jip_jumlah_produksi, jip_jumlah_lain, jip_jumlah_pemilik, jip_jumlah, jip_pengeluaran, jip_tahun', 'numerical', 'integerOnly'=>true),
			array('jip_kodejenis', 'length', 'max'=>128),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jip_id, jip_kodejenis, jip_jumlah_industri, jip_jumlah_produksi, jip_jumlah_lain, jip_jumlah_pemilik, jip_jumlah, jip_pengeluaran, jip_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jip_id' => 'Jip',
			'jip_kodejenis' => 'Kode Jenis',
			'jip_jumlah_industri' => 'Jumlah Industri',
			'jip_jumlah_produksi' => 'Pekerja dibayar Produksi',
			'jip_jumlah_lain' => 'Pekerja dibayar Lainnya',
			'jip_jumlah_pemilik' => 'Pekerja Pemilik',
			'jip_jumlah' => 'Jumlah',
			'jip_pengeluaran' => 'Pengeluaran Pekerja',
			'jip_tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jip_id',$this->jip_id);
		$criteria->compare('jip_kodejenis',$this->jip_kodejenis,true);
		$criteria->compare('jip_jumlah_industri',$this->jip_jumlah_industri);
		$criteria->compare('jip_jumlah_produksi',$this->jip_jumlah_produksi);
		$criteria->compare('jip_jumlah_lain',$this->jip_jumlah_lain);
		$criteria->compare('jip_jumlah_pemilik',$this->jip_jumlah_pemilik);
		$criteria->compare('jip_jumlah',$this->jip_jumlah);
		$criteria->compare('jip_pengeluaran',$this->jip_pengeluaran);
		$criteria->compare('jip_tahun',$this->jip_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}